﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Q.M.Sell.Doamin.Entity
{
    /// <summary>
    /// 销售表
    /// </summary>
    [SugarTable("sales")]
    public class sales
    {
        /// <summary>
        /// 销售单号
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, ColumnDescription = "销售ID", Length = 50)]
        public string salesid { get; set; }

        /// <summary>
        /// 销售订单主题
        /// </summary>
        [SugarColumn(ColumnDescription = "销售订单主题", Length = 50)]
        public string? sales_order_subject { get; set; }

        /// <summary>
        /// 销售日期
        /// </summary>
        [SugarColumn(ColumnDescription = "销售日期")]
        public DateTime? sales_date { get; set; }

        /// <summary>
        /// 客户名称
        /// </summary>
        [SugarColumn(ColumnDescription = "客户名称", Length = 50)]
        public string? customer_name { get; set; }

        /// <summary>
        /// 联系人
        /// </summary>
        [SugarColumn(ColumnDescription = "联系人", Length = 50)]
        public string? contact { get; set; }

        /// <summary>
        /// 联系方式
        /// </summary>
        [SugarColumn(ColumnDescription = "联系方式", Length = 50)]
        public string? contact_information { get; set; }

        /// <summary>
        /// 结算方式
        /// </summary>
        [SugarColumn(ColumnDescription = "结算方式")]
        public means_of_payments means_of_payments { get; set; }  // 辅助字段类型可能需要调整

        /// <summary>
        /// 客户订单号
        /// </summary>
        [SugarColumn(ColumnDescription = "客户订单号", Length = 50)]
        public string? customer_order_number { get; set; }

        /// <summary>
        /// 交货地址
        /// </summary>
        [SugarColumn(ColumnDescription = "交货地址", Length = 50)]
        public string? delivery_address { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnDescription = "备注", Length = 50)]
        public string? comment { get; set; }

        /// <summary>
        /// 产品概要
        /// </summary>
        [SugarColumn(ColumnDescription = "产品概要", Length = 50)]
        public string? product_summary { get; set; }

        /// <summary>
        /// 总金额
        /// </summary>
        [SugarColumn(ColumnDescription = "总金额")]
        public decimal totalmoney { get; set; }

        /// <summary>
        /// 优惠后金额
        /// </summary>
        [SugarColumn(ColumnDescription = "优惠后金额")]
        public decimal amount_after_concession { get; set; }

        /// <summary>
        /// 已收金额
        /// </summary>
        [SugarColumn(ColumnDescription = "已收金额")]
        public decimal amount_received { get; set; }

        /// <summary>
        /// 已开票金额
        /// </summary>
        [SugarColumn(ColumnDescription = "已开票金额")]
        public decimal invoiced_amount { get; set; }

        /// <summary>
        /// 出库
        /// </summary>
        [SugarColumn(ColumnDescription = "出库")]
        public bool stock_removal { get; set; }

        /// <summary>
        /// 开票
        /// </summary>
        [SugarColumn(ColumnDescription = "开票")]
        public bool make_out_an_invoice { get; set; }

        /// <summary>
        /// 收款
        /// </summary>
        [SugarColumn(ColumnDescription = "收款")]
        public bool gathering { get; set; }
        /// <summary>
        /// 添加时间
        /// </summary>
        [SugarColumn(ColumnDescription = "添加时间")]
        public DateTime selldate { get; set; } = DateTime.Now;
        /// <summary>
        ///审批字段
        /// </summary>
        [SugarColumn(ColumnDescription = "审批字段")]
        public bool examine_and_approve { get; set; } = false;
    }
}
